package com.smartjobs.action;

import java.util.ArrayList;
import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.smartjobs.bean.CompanyBean;
import com.smartjobs.bean.JobpostingCompanySkillBean;
import com.smartjobs.bean.SkillMasterBean;
import com.smartjobs.model.ViewCompanyDataModel;
import com.smartjobs.model.ViewJSProfileModel;

@SuppressWarnings("serial")
public class ViewCompanyDataAction extends ActionSupport {

	@SuppressWarnings("rawtypes")
	Map session = ActionContext.getContext().getSession();
	CompanyBean company;
	ArrayList<JobpostingCompanySkillBean> jobpostingList;
	ArrayList<SkillMasterBean> skillMasterList;

	public ArrayList<SkillMasterBean> getSkillMasterList() {
		return skillMasterList;
	}

	public void setSkillMasterList(ArrayList<SkillMasterBean> skillMasterList) {
		this.skillMasterList = skillMasterList;
	}

	public ArrayList<JobpostingCompanySkillBean> getJobpostingList() {
		return jobpostingList;
	}

	public void setJobpostingList(
			ArrayList<JobpostingCompanySkillBean> jobpostingList) {
		this.jobpostingList = jobpostingList;
	}

	public CompanyBean getCompany() {
		return company;
	}

	public void setCompany(CompanyBean company) {
		this.company = company;
	}

	public String GetCompanyProfile() {

		company = new CompanyBean();
		company.setCompanyID((int) session.get("companyID"));
		ViewCompanyDataModel.GetCompanyProfile(company);
		GetJobpostings();
		return SUCCESS;

	}

	public String GetJobpostings() {

		jobpostingList = new ArrayList<JobpostingCompanySkillBean>();
		skillMasterList = new ArrayList<SkillMasterBean>();
		int companyID = (int) session.get("companyID");
		ViewCompanyDataModel.GetJobpostings(companyID, jobpostingList);
		ViewJSProfileModel.GetSkillMasterList(skillMasterList);
		return SUCCESS;

	}

}
